import React from 'react';
import { Button } from 'antd'
import { useNavigate } from 'react-router-dom';
const Index = () => {
  const navigate = useNavigate() // 返回一个函数

  const loginHandler = () => {
    // 编程式导航
    navigate("/home?id=1")  // 带参数跳转到home

  }
  return (
    <div>
      <h1>LOG IN</h1>
      <div>
        <Button type="primary" onClick={loginHandler}>登录</Button>
      </div>
    </div>
  );
}

export default Index;
